// 导入myaxios
import myaxios from "@/http/MyAxios";
// 导入BaseUrl
import BaseUrl from "@/http/BaseUrl";
const QMYBURL = BaseUrl.QMYBURL
// 请求
const examination = {
    /**
 * 
 * @returns 请求所有省
 */
    eLoactionProvincesAll() {
        return myaxios.get(QMYBURL + '/provinces-all');
    },

    /**
     * 请求所有的医院
     * @param params 请求需要的参数{page，页码，pagesize，每一页的数量}
     */
    eRequestHospitalAll(params: any) {
        let url = QMYBURL + '/hospital-all'
        return myaxios.get(url, params)
    },

    /**
     * 请求通过省份查询医院
     * @param params {h_province}名称(例:'重庆');
     */
    hospitalByProvince(params: any) {
        let url = QMYBURL + '/hospitalBy-province';
        return myaxios.post(url, params);
    },

    /**
     * 通过医院ID查询医院信息
     * @param params 
     * @returns 
     */
    queryHospitalById(params: any) {
        return myaxios.get(QMYBURL + '/hospitalById', params)
    },
    // http://localhost:3010/packageBy_hospital?hospital_id=1

    /**
     * 查询某个医院的体检套餐
     * 
     * hospital_id医院的id
     * 
     */
    queryPackageByHospital(params: any) {
        return myaxios.get(QMYBURL + '/packageBy_hospital', params)
    },

    /**
     * 
     * 根据id查询套餐
     * s_id 
     */
    queryOnePackage(params: any) {
        return myaxios.post(QMYBURL + '/packageById', params);
    },

    /**
     * 
     * 根据id查询医院
     * s_id 
     */
    hospitalById(params: any) {
        return myaxios.get(QMYBURL + '/hospitalById', params);
    },

    /**
     * 按照医院等级降序排列
     * @returns 
     */
    hospitalDesc() {
        return myaxios.get(QMYBURL + '/hospital/desc')
    },

    /**
     * 按照医院等级升序排列
     * @returns 
     */
    hospitalAsc() {
        return myaxios.get(QMYBURL + '/hospital/asc')
    },

    // package/sort
    /**
     * 更具选择套餐的类型查询对应的体检套餐信息
     * @param params 
     * @returns 
     */
    queryTiJianSelect(params: object) {
        return myaxios.post(QMYBURL + '/package/sort', params);
    },
    // /hospitalLikeName

    /**
     * 模糊查询医院
     * @param params h_name搜索
     */
    vagueSelectHospitals(params: object) {
        return myaxios.post(QMYBURL + '/hospitalLikeName', params);
    },

    /**
     * 预约体检
     * @param params 
     * @returns 
     */
    chekUpDdd(params: object){
        console.log('params:',params);
        return myaxios.post(QMYBURL+'/ChekUp/add',params);
    }

}

export default examination